var req;

function validarLogin (login,senha){
    
    if(window.XMLHttpRequest) {
        req = new XMLHttpRequest();
    }
    
    else if (window.ActiveXObject){
        req = new ActiveXObject("Microsoft.XMLHttp");
    }
    
var url = "ajax/validação.php?campo="+campo+"&valor"+valor;

req.open("Get", url, true);

req.onreadystatechange = function(){
    if(req.readyState == 1){
        document.getElementById('campo_'+campo+'').innerHTML = '<font color="green">Verificando...</font>';
        
        var resposta = req.responseText;
        
        document.getElementById('campo_'+ campo +'').innerHTML = resposta;
    }
}
req.send(null);   
}